{template 'header'}
    <div class="row">
        <div class="col-lg-12 ">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="page-toolbar">
                        <div class="col-sm-6">
                        <span class=""><a class="btn btn-primary btn-sm" href="{php echo webUrl('user/user/add')}">
                            <i class="fa fa-plus"></i>
                            添加新操作员</a>
                        </span>
                        </div>
                        <div class="col-sm-6 pull-right">
                            <form action="{php echo webUrl('user.user')}" method="post" enctype="multipart/form-data" class="form-horizontal" form-jump='1'>
                            <div class="input-group">
                                 <span class="input-group-selectn">
                                      <select name="roleid" class="form-control">
                                           <option value="0">全部</option>
                                          {loop $roles $v}
                                          <option value="{$v['id']}" {if $v['id'] == $_GP['roleid']}selected = "selected"{/if}>{$v['rolename']}</option>
                                          {/loop}
                                      </select>
                                 </span>
                                <span class="input-group-select">
                                        <select name="status" class="form-control ">
                                            <option value="" selected="">全部</option>
                                            <option value="1"  {if $status==1}selected="selected"{/if}>启用</option>
                                            <option value="0" {if $status=='0'}selected="selected"{/if}>禁用</option>
                                        </select>
                                </span>
                                <input type="text" class=" form-control" name="keyword" value="" placeholder="请输入关键词"> <span class="input-group-btn">
                             <button class="btn  btn-primary" type="submit"> 搜索</button> </span>
                            </div>
                            </form>
                        </div>
                    </div>
                    <table class="table table-hover  bootstrap-datatable datatable  ">
                        {if !empty($list)}
                        <thead>
                        <tr>
                            <th>登录id</th>
                            <th>角色</th>
                            <th>姓名</th>
                            <th>手机</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {loop $list $row}
                        <tr>
                            <td>{$row['username']}</td>
                            <td>{php echo !empty($row['rolename'])?$row['rolename']:'无'}</td>
                            <td>{$row['realname']}</td>
                            <td>{$row['mobile']}</td>
                            <td>
                                <span class="{if $row['status']==1}label label-warning{else}label{/if}" data-ajax="{php echo webUrl('user.user.status',array('id'=>$row['id']))}" list-class="{if $row['status']==1}label{else}label label-warning{/if}" list-html="{if $row['status']==1}禁用{else}启用{/if}">{if $row['status']==1}启用{else}禁用{/if}</span>
                            </td>
                            <td style="width:100px;">
                                <div class="link-group">
                                    <a class="btn btn-info"
                                       href="{php echo weburl('user.user.edit', array('id' => $row['id'], 'm' => MODEL_NAME));}">
                                        <i class="fa fa-edit "></i>
                                    </a>
                                    <a class="btn btn-danger btn-ajax"
                                       href="javascript:vord(0)" data-ajax="{php echo webUrl('user.user.delete',array('id'=>$row['id']))}" title="确认删除？">
                                        <i class="fa fa-trash-o "></i>
                                    </a>
                                </div>
                            </td>
                        </tr>
                        {/loop}

                        </tbody>
                        {else}
                        <thead>
                        <tr>
                            <th colspan="6">暂无数据</th>
                        </tr>
                        </thead>
                        {/if}

                    </table>
                    <hr style="margin: 0px 0px;padding: 0px 0px"/>

                    {php echo $pager;}
                </div>
            </div>
        </div><!--/col-->

    </div><!--/row-->
{template 'footer'}